package com.ruicar.afs.cloud.parameter.commom.enums;

import lombok.Getter;

/**
 * @description: 购车目的枚举
 * @author: sijun.yu
 * @date: 2020/5/13 19:40
 */
@Getter
public enum CarPurpose {

    SELF_USE("00", "自用"),
    COMMERCIAL_USE("01", "商用");

    private final String index;
    private final String name;

    private CarPurpose(String index, String name) {
        this.index = index;
        this.name = name;
    }

    public static String getName(String index) {
        for (CarPurpose carPurpose : CarPurpose.values()) {
            if (carPurpose.getIndex().equals(index)) {
                return carPurpose.getName();
            }
        }
        return null;
    }

}
